/* GUI CONVERTED from reoprp25.p (converter v1.75) Sat Aug 12 23:07:03 2000 */
/* reoprp25.p - DETAILED REJECT REPORT FROM OPERATIONS BY REASON CODE   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert reoprp25.p (converter v1.00) Fri Oct 10 13:57:18 1997 */
/* web tag in reoprp25.p (converter v1.00) Mon Oct 06 14:17:43 1997 */
/*F0PN*/ /*K10K*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0      LAST MODIFIED: 06/25/87   BY: EMB *A9*            */
/* REVISION: 5.0      LAST MODIFIED: 03/28/89   BY: EMB                 */
/* REVISION: 6.0      LAST MODIFIED: 07/23/91   BY: bjb *D782*          */
/* REVISION: 7.2      LAST MODIFIED: 11/23/94   BY: cpp *FT95*          */
/* REVISION: 8.6      LAST MODIFIED: 10/15/97   BY: GYK *K10K*          */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 05/04/00   BY: *N09M* Inna Lyubarsky */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */

 /*K10K*/ /* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K10K*/  {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */
/*N09M -- DELETED TRANSLATABLE STRINGS DEFINITIONS ----------- *
&SCOPED-DEFINE reoprp25_p_1 "Reject Code: "
/* MaxLen: Comment: */
*N09M -------------------------------------------------------- */
/* ********** End Translatable Strings Definitions ********* */

/*D782*/ define new global shared variable global_rsntyp like rsn_type.
     define variable rsn         like op_rsn.
     define variable rsn1        like op_rsn.
     define variable part        like pt_part.
     define variable part1       like pt_part.
     define variable ptgroup     like pt_group.
     define variable group1      like pt_group.
     define variable opdate      like op_date.
     define variable opdate1     like op_date.
     define variable desc1       like pt_desc1.
     define variable ytd_prod    as decimal format "->>>,>>>,>>9".
     define variable name        like ro_desc.
     define variable scrap_desc  like rsn_desc.
     define variable display_rsn like mfc_logical.
     define variable last_part   like op_part.
/*K10K*
     /* DISPLAY TITLE */
     {mfdtitle.i "b+ "}
*K10K*/

     opdate = date(1,1,year (today)).

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
rsn       colon 15      rsn1      label {t001.i} colon 49 skip
        part      colon 15      part1     label {t001.i} colon 49 skip
        opdate    colon 15      opdate1   label {t001.i} colon 49 skip
      SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

/*D782*/ global_rsntyp = "reject".

/*K10K*/ {wbrp01.i}

/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

        if opdate = low_date then opdate = ?.
        if opdate1 = hi_date then opdate1 = ?.
        if part1 = hi_char then part1 = "".
        if rsn1 = hi_char then rsn1 = "".

/*K10K*/ if c-application-mode <> 'web' then
         
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K10K*/ {wbrp06.i &command = update &fields = "  rsn rsn1 part part1 opdate
opdate1" &frm = "a"}

/*K10K*/ if (c-application-mode <> 'web') or
/*K10K*/ (c-application-mode = 'web' and
/*K10K*/ (c-web-request begins 'data')) then do:

        bcdparm = "".
        {mfquoter.i rsn    }
        {mfquoter.i rsn1   }
        {mfquoter.i part   }
        {mfquoter.i part1  }
        {mfquoter.i opdate }
        {mfquoter.i opdate1}

        if opdate = ? then opdate = low_date.
        if opdate1 = ? then opdate1 = hi_date.
        if part1 = "" then part1 = hi_char.
        if rsn1 = "" then rsn1 = hi_char.

/*K10K*/ end.
           /* SELECT PRINTER  */
           
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




        {mfphead.i}

        for each rsn_ref where rsn_type = "reject"
        and rsn_code >= rsn and rsn_code <= rsn1
        no-lock by rsn_code:

           display_rsn =yes.
           last_part = ?.

           for each op_hist use-index op_rsn_rjct
           where op_rsn_rjct = rsn_code
           and (op_part >= part and op_part <= part1)
           and (op_wo_op = op_wo_op)
           and (op_date >= opdate and op_date <= opdate1)
           and op_qty_rjct <> 0
           no-lock by op_part by op_wo_op by op_date
           with frame b width 132 no-attr-space:

             /* SET EXTERNAL LABELS */
             setFrameLabels(frame b:handle).

          if display_rsn then do with frame b:
             display_rsn = no.
             if page-size - line-counter < 2 then page.
             display WITH STREAM-IO /*GUI*/ .
/*N09M       put {&reoprp25_p_1} op_rsn_rjct rsn_desc skip(1). */
/*N09M*/     put {gplblfmt.i
         &FUNC=getTermLabel(""REJECT_CODE"",15)
         &CONCAT="': '"
         } op_rsn_rjct rsn_desc skip(1).
          end.

          if op_part <> last_part then do with frame b:
             find pt_mstr where pt_part = op_part no-lock no-error.
             display space(2) op_part WITH STREAM-IO /*GUI*/ .
             if available pt_mstr then display pt_desc1 WITH STREAM-IO /*GUI*/ .
             last_part = op_part.
          end.

          name = "".
          find ro_det where ro_routing = op_part
          and ro_op = op_wo_op no-lock no-error.
          if available ro_det then name = ro_desc.

          display op_wo_op name op_wkctr op_mch
/*FT95*           op_qty_rjct op_date op_trnbr with frame b. */
/*FT95*/          op_qty_rjct op_date op_trnbr format ">>>>>>>9" with frame b STREAM-IO /*GUI*/ .

           end.

           
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

        end.

        /* REPORT TRAILER */
        
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


     end.

/*K10K*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" rsn rsn1 part part1 opdate opdate1 "} /*Drive the Report*/
